<?php
/**
 * @version		$Id: default.php 3 2011-12-16 20:19:15Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */
 
defined('_JEXEC') or die('Restricted Access');
JHtml::_('behavior.tooltip');
JHTML::_('script','system/multiselect.js',false,true);
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
$config = JFactory::getConfig();
$params = JComponentHelper::getParams('com_almhoster');
$currency 	= $params->get("UseCurrency");
?>
<form action="<?php echo JRoute::_('index.php?option=com_almhoster&view=prices'); ?>" method="post" name="adminForm">
	<fieldset id="filter-bar">
		<div class="filter-select fltrt">		
			<select name="filter_product_id" class="inputbox" onchange="this.form.submit()">
				<option value=""><?php echo JText::_('COM_ALMHOSTER_FILTER_BY_PRODUCT');?></option>
				<?php echo JHtml::_('select.options', $this->product, 'value', 'text', $this->state->get('filter.product_id'));?>
			</select>		
		</div>
		<div class="filter-select fltrt">		
			<select name="filter_billingcycle_id" class="inputbox" onchange="this.form.submit()">
				<option value=""><?php echo JText::_('COM_ALMHOSTER_FILTER_BY_BILLING_CYCLE');?></option>
				<?php echo JHtml::_('select.options', $this->billingCycle, 'value', 'text', $this->state->get('filter.billingcycle_id'));?>
			</select>		
		</div>
	</fieldset>
<div class="clr"></div>
<table class="adminlist">
	<thead>
	<tr>
	<th width="5">
		<?php echo JHtml::_('grid.sort',  'Id', 'PriceId', $listDirn, $listOrder); ?>
	</th>
	<th width="10">
		<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
	</th>		
	<th class="title">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRICE_FOR_PRODUCT', 'PriceProduct', $listDirn, $listOrder); ?>
	</th>
	<th width="15%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRICE_BILLING_CYCLE_LABEL', 'PriceBillingCycle', $listDirn, $listOrder); ?>
	</th>
	<th width="10%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRICE_AMOUNT', 'PriceAmount', $listDirn, $listOrder); ?>
	</th>
	<th width="10%">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_PRICE_STATUS', 'PriceActive', $listDirn, $listOrder); ?>
	</th>
	</tr>
</thead>
<tfoot>	
	<tr>
	<td colspan="6">
		<?php echo $this->pagination->getListFooter(); ?></td>
	</tr>		
</tfoot>
<tbody>
	<?php foreach($this->items as $i => $item): 
?>
	<tr class="row<?php echo $i % 2; ?>">
		<td>
			<?php echo $item->PriceId; ?>
		</td>
		<td>
			<?php echo JHtml::_('grid.id', $i, $item->PriceId); ?>
		</td>
		<td>
		<a href="<?php echo JRoute::_('index.php?option=com_almhoster&task=price.edit&PriceId=' . $item->PriceId); ?>">
				<?php echo $item->product; ?>
				</a>
		</td>
		<td align="left">
			<?php echo $item->billing_cycle; ?>
		</td>
		<td align="right">
			<?php echo $item->PriceAmount, JText::_(' '), JText::_('COM_ALMHOSTER_BILLING_CURRENCY_'.$currency); ?>
		</td>
		<td  align="center">
			<?php echo JText::_('COM_ALMHOSTER_PRICING_USE_LIST_'.$item->PriceActive); ?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
	</table>
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>
